Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLF4J support #52

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mramsden
Copy link

This is based on the conversation over on #48. I have migrated the project from using java.util.logging to SLF4J. This should make it easier for those depending on this library to control the logging that is coming out of the library.

There are some changes to how the CLI application needs to be built. Now when creating the OtsCli.jar it should be built with mvn install -P cli which will activate the CLI profile. This adds Logback Classic and a basic stdout log appender configuration to the CLI jar. This will allow log messages to be emitted on the command line.

All references to java.util.logging have now been removed with SLF4J as the preferred approach. Also the tests have a dependency on Logback Classic to ensure that the correct log message is output on one of the tests.

Remaining tasks

  • Test this with an existing application to make sure that the logging can be configured as required.

@mramsden mramsden marked this pull request as draft November 15, 2020 12:57
@RCasatta
Copy link
Member

Isn't java.util.logging more agnostic so that dependent library could choose which logging implementation do they prefer?

Can't we follow @lvaccaro suggestion #48 (comment) remove slf4j from the lib, then maybe use logback/slf4j in the cli profile?

@mramsden
Copy link
Author

Yep, that's probably a good idea. I'll get this updated to use that in preference to SLF4J.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants